home *** CD-ROM | disk | FTP | other *** search
- *** /tmp/,RCSt1a24495 Thu Aug 31 21:09:34 1989
- --- dirtent.h Thu Aug 31 21:09:02 1989
- ***************
- *** 1,3 ****
- --- 1,6 ----
- + #ifndef _DIRENT_H
- + #define _DIRENT_H
- +
- /*
- <dirent.h> -- definitions for SVR3 directory access routines
-
- ***************
- *** 19,24 ****
- --- 22,49 ----
- char *dd_buf; /* -> directory block */
- } DIR; /* stream data from opendir() */
-
- + #ifdef __STDC__
- + #include <std.h>
- + #ifndef __NO_PROTO__
- + int closedir(DIR *);
- + int getdents(int, char *, unsigned);
- + DIR *opendir(char *);
- + struct dirent *readdir(DIR *);
- + void rewinddir(DIR *);
- + void seekdir(DIR *, long);
- + off_t telldir(DIR *);
- + #else
- + extern int closedir();
- + extern int getdents();
- + extern DIR *opendir();
- + extern struct dirent *readdir();
- + extern void rewinddir();
- + extern void seekdir();
- + extern off_t telldir();
- + #endif /* __NO_PROTO__ */
- +
- + #else
- +
- extern DIR *opendir();
- extern struct dirent *readdir();
- extern off_t telldir();
- ***************
- *** 26,31 ****
- --- 51,64 ----
- extern void rewinddir();
- extern int closedir();
-
- + #endif
- +
- #ifndef NULL
- + #ifdef __STDC__
- + #define NULL ((void *)0L) /* DAG -- added for convenience */
- + #else
- #define NULL 0 /* DAG -- added for convenience */
- #endif
- + #endif
- +
- + #endif /* _DIRENT_H */
- *** /tmp/,RCSt1a24495 Thu Aug 31 21:09:37 1989
- --- getdents.c Thu Aug 31 21:09:03 1989
- ***************
- *** 102,108 ****
- extern int errno;
-
- #ifndef DIRBLKSIZ
- ! #define DIRBLKSIZ 1024 /* directory file read buffer size */
- #endif
-
- #ifndef NULL
- --- 102,115 ----
- extern int errno;
-
- #ifndef DIRBLKSIZ
- ! /* directory file read buffer size
- ! * For directory files with fixed sized records, this should be a
- ! * multiple of the record size. For variable sized records, this code
- ! * is probably unreliable if the directory is larger than DIRBLKSIZ --
- ! * so make DIRBLKSIZ big.
- ! */
- ! /* #define DIRBLKSIZ ((int)(64*sizeof(struct direct))) */ /* ==1024 */
- ! #define DIRBLKSIZ 1024
- #endif
-
- #ifndef NULL
- ***************
- *** 111,116 ****
- --- 118,124 ----
-
- #ifndef SEEK_CUR
- #define SEEK_CUR 1
- + #define SEEK_SET 0
- #endif
-
- #ifndef S_ISDIR /* macro to test for directory file */
- ***************
- *** 272,279 ****
-
- if ( (char *)bp + reclen > &buf[nbyte] )
- {
- ! errno = EINVAL;
- ! return -1; /* buf too small */
- }
-
- bp->d_ino = dp->d_fileno;
- --- 280,297 ----
-
- if ( (char *)bp + reclen > &buf[nbyte] )
- {
- ! /* fix thanks to culberts@hpccc.HP.COM (Bruce Culbertson) */
- ! /* buf too small, lseek so we get the
- ! * rest on next call to getdents()
- ! */
- ! if (lseek (fildes,
- ! (long)((char *)dp-u.dblk+offset),
- ! SEEK_SET) < 0)
- ! {
- ! /* errno set by lseek */
- ! return -1;
- ! }
- ! break;
- }
-
- bp->d_ino = dp->d_fileno;
- *** /tmp/,RCSt1a24495 Thu Aug 31 21:09:43 1989
- --- sys.dirtent.h Thu Aug 31 21:09:04 1989
- ***************
- *** 1,3 ****
- --- 1,6 ----
- + #ifndef _SYS_DIRENT_H
- + #define _SYS_DIRENT_H
- +
- /*
- <sys/dirent.h> -- file system independent directory entry (SVR3)
-
- ***************
- *** 16,25 ****
-
- /* The following nonportable ugliness could have been avoided by defining
- DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments. */
- ! #define DIRENTBASESIZ (((struct dirent *)0)->d_name \
- ! - (char *)&((struct dirent *)0)->d_ino)
- ! #define DIRENTSIZ( namlen ) ((DIRENTBASESIZ + sizeof(long) + (namlen)) \
- ! / sizeof(long) * sizeof(long))
-
- /* DAG -- the following was moved from <dirent.h>, which was the wrong place */
- #define MAXNAMLEN 512 /* maximum filename length */
- --- 19,28 ----
-
- /* The following nonportable ugliness could have been avoided by defining
- DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments. */
- ! #define DIRENTBASESIZ (int)((((struct dirent *)0)->d_name \
- ! - (char *)&((struct dirent *)0)->d_ino))
- ! #define DIRENTSIZ( namlen ) (int)(((DIRENTBASESIZ + sizeof(long) + (namlen)) \
- ! / sizeof(long) * sizeof(long)))
-
- /* DAG -- the following was moved from <dirent.h>, which was the wrong place */
- #define MAXNAMLEN 512 /* maximum filename length */
- ***************
- *** 27,29 ****
- --- 30,34 ----
- #ifndef NAME_MAX
- #define NAME_MAX (MAXNAMLEN - 1) /* DAG -- added for POSIX */
- #endif
- +
- + #endif /* _SYS_DIRENT_H */
-